home *** CD-ROM | disk | FTP | other *** search
- /* ======================================================================
- DESC: Common Group Functions for the Administer Operations
-
- PLATFORMS: >= MS IE 4.0
-
- USAGE NOTES:
- ====================================================================== */
- var GrpLupRecCount = 0; // Count of records returned from Group Lookup operation
- var GrpSelectIdx = 0; // Index of currently selected Group
- var GroupRecLength = 4; // Length of a Group Lookup record in the Store
-
- /* Process Group LOOKUP RECORD Event */
- function processGroupLookupRecord(Gid,GrpName,GrpDesc,GNameObj,GStoreObj) {
- // place data from Lookup Record into specified Store
- ++GrpLupRecCount;
- if ( GNameObj != null ) {
- addElementToSelect(GNameObj,GrpName);
- }
- // Add to Storage
- addElementToSelect(GStoreObj,GrpName);
- addElementToSelect(GStoreObj,Gid);
- addElementToSelect(GStoreObj,GrpDesc);
- addElementToSelect(GStoreObj,0);
- GroupRecLength = 4;
- }
-
- /* Process DB Error in Group Lookup Operation */
- function processGroupOpError() {
- top.Rstatus.Pstat("An error occurred during GROUP LOOKUP operation",true);
- }
-
- /* Get Group Name from Store based on Group ID */
- function getGroupName(Gid,GSelObj,GStoreObj) {
- var GrpName = "";
- for (var i=0, j=0; i < GStoreObj.length; ++j, i+=GroupRecLength) {
- if ( GStoreObj.options[i+1].text == Gid ) {
- GrpName = GStoreObj.options[i].text;
- GrpSelectIdx = j;
- if ( GSelObj != null ) {
- GSelObj.options[j].selected = "selected";
- }
- break;
- }
- }
- return GrpName;
- }
-
- /* Get Group ID from Store based on Group Name */
- function getGroupID(GNM,GStoreObj) {
- var GID = 0;
- for (var i=0, j=0; i < GStoreObj.length; ++j, i+=GroupRecLength) {
- if ( GStoreObj.options[i].text == GNM ) {
- GrpSelectIdx = j;
- GID = GStoreObj.options[i+1].text;
- break;
- }
- }
- return GID;
- }
-
- /* Unconditionally deselect all Group names in combo */
- function allDeselectGroup(GSelObj) {
- GSelObj.selectedIndex = -1;
- }
-
- /* Are all Group Names Selected in combo? */
- function IsAllGroupSelected(GSobj,GCobj) {
- allGSel = 0; // initialize count
- var lth = GCobj.length; // number of entries in the Combo
- for (var i=0, j=3; i < lth; ++i, j+=GroupRecLength) { // Check each one
- if (GCobj.options[i].selected) { // Selected?
- GSobj.options[j].text = 1; // set selected
- ++allGSel;
- }
- else {
- GSobj.options[j].text = 0; // set unselected
- }
- }
- allGSel = ((allGSel == 0) || (allGSel == lth)) ? 1 : 0;
- return allGSel;
- }
-
- /* Expand Group Name Field on MouseOver Event; Restore Group Name Field on MouseOut Event */
- function processGroupMouseOver(GCBobj) {
- if ( GCBobj.size > 1 ) { // if already set
- return; // ignore
- }
- if (GCBobj.multiple == 1 && GCBobj.length != 0) {
- GCBobj.size = (GCBobj.length < 4) ? GCBobj.length : 4;
- }
- }
- function processGroupMouseOut(GCBobj) {
- if (GCBobj.multiple == 1) {
- GCBobj.size = 1;
- }
- }
-